<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>ECharts 测试</title>
  <!-- 引入 ECharts -->
  <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.min.js"></script>
  <style>
    body {
      margin: 0;
      padding: 20px;
      background-color: #1f2937;
      color: #f3f4f6;
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    }
    .chart-container {
      width: 100%;
      height: 400px;
      background-color: #272E3B;
      border-radius: 0.75rem;
      padding: 1.5rem;
      box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    }
    .chart-title {
      font-size: 1.125rem;
      font-weight: 600;
      margin-bottom: 1.5rem;
    }
    #executionTrendChart {
      width: 100%;
      height: 300px;
    }
  </style>
</head>
<body>
  <div class="chart-container">
    <div class="chart-title">测试执行趋势 (直接HTML测试)</div>
    <div id="executionTrendChart"></div>
  </div>

  <script>
    // 等待DOM加载完成
    document.addEventListener('DOMContentLoaded', function() {
      // 初始化图表
      const trendChart = echarts.init(document.getElementById('executionTrendChart'));
      
      // 设置图表配置
      const option = {
        backgroundColor: 'transparent',
        tooltip: {
          trigger: 'axis'
        },
        legend: {
          data: ['通过', '失败'],
          textStyle: {
            color: '#9CA3AF'
          },
          top: 10,
          right: 20
        },
        xAxis: {
          type: 'category',
          data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
        },
        yAxis: {
          type: 'value',
          max: 35
        },
        series: [
          {
            name: '通过',
            type: 'line',
            data: [20, 25, 23, 32, 28, 15, 26],
            smooth: true,
            lineStyle: {
              color: '#52C41A',
              width: 3
            }
          },
          {
            name: '失败',
            type: 'line',
            data: [5, 4, 6, 5, 7, 3, 6],
            smooth: true,
            lineStyle: {
              color: '#FF4D4F',
              width: 3
            }
          }
        ]
      };
      
      // 应用配置
      trendChart.setOption(option);
      
      // 窗口大小变化时重新调整图表大小
      window.addEventListener('resize', function() {
        trendChart.resize();
      });
    });
  </script>
</body>
</html>